home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
tshell10.arc
/
EXAMPLE.PAS
next >
Wrap
Pascal/Delphi Source File
|
1987-03-14
|
2KB
|
77 lines
(*
* this program demonstrates and tests the facilities of TSHELL 1.0
*
*)
program tshell_tester;
{this statement will place a "signature" into the .com file where it can
be detected and used for configuration management}
const example_tag: string[90]
= #0'@(#)CURRENT_FILE LAST_UPDATE Example program 1.0'#0;
{define some macros}
#define WHOAMI test program 1
#define DEBUG {this macro will control generation of debug code}
#define LEV2 {this macro will enable low level debug code}
begin
{test preprocessed source listing}
#pragma LIST
{This will show during compilation}
writeln('whoami=WHOAMI');
#pragma NOLIST
{the following writeln should NOT be expanded}
#pragma NOEXPAND
writeln('whoami=WHOAMI (shouldn''t say "test program 1")');
#pragma EXPAND
{test predefined symbols}
writeln('system_date=SYSTEM_DATE (date last compiled)');
writeln('last_update=LAST_UPDATE (date last updated)');
writeln('current_filename=CURRENT_FILE (source filename)');
{test conditional compilation}
#ifdef DEBUG
writeln('debug enabled');
#ifdef LEV2
writeln('debug lev2');
#ifdef LEV3
writeln('debug lev3');
#endif
#else
writeln('debug not lev2');
#endif
#else
writeln('not debugging');
#ifdef LEV2
writeln('not debug lev2');
#else
writeln('not debug not lev2');
#endif
#endif
{test the #undef command}
#define TEST1 Test-1
writeln('test1="TEST1" <-- should say Test-1');
#undef TEST1
writeln('test1="TEST1" <-- should say TEST1');
end.